package com.yc.damai.damaiindex.web.fegin;

import com.yc.damai.bean.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/9/6
 * Email haijunzhou@hnit.edu.cn
 */
@FeignClient(value = "damai-user", fallback = UserActionImpl.class) // 服务名全局唯一
public interface UserAction {

    @RequestMapping("user")
    String user();

    @RequestMapping("hello")
    String hello(@RequestParam("name") String name);

    @RequestMapping("add")
    int add(@RequestParam("a") int a, @RequestParam("b") int b);

    @RequestMapping("sub/{x}/{y}")
    String sub(@PathVariable int x, @PathVariable int y);

    @RequestMapping("result")
    Result result(@RequestBody Result result);

}
